import { getShopSeller, getShopRatings } from '../../api/shop'
export default {
  namespaced: true,
  state: {
    shops: [],
    shopRatings: []
  },
  mutations: {
    SET_SHOPS(state, payload) {
      state.goods = payload
    },
    SET_SHOP_RATINGS(state, payload) {
      state.goods = payload
    }
  },
  actions: {
    getShopSeller({ commit }) {
      getShopSeller().then((res) => {
        commit('SET_SHOPS', res.data)
      })
    },
    getShopRatings({ commit }) {
      getShopRatings().then((res) => {
        commit('SET_SHOP_RATINGS', res.data)
      })
    }
  }
}
